package com.sykj.springboot.test.designMode.Observer4;

import java.util.Observable;
import java.util.Observer;

public class Hanfeizi extends Observable {



    public void haveBreakFast() {
        System.out.println("韩非子：开始吃早饭");
        //通知所有观察者
        super.setChanged();
        super.notifyObservers("韩非子开始吃早饭了");
    }

    public void haveFun() {
        System.out.println("韩非子：开始娱乐了");
        super.setChanged();
        super.notifyObservers("韩非子开始吃早饭了");
    }


}
